package com.horizon.im.imClient.feignClient;

import com.horizon.constants.ServerConstants;
import com.horizon.entity.LoginBack;
import com.horizon.util.JsonUtil;
import feign.Feign;
import feign.codec.StringDecoder;
import org.apache.zookeeper.Login;

public class WebOperator {
    public static LoginBack login(String userName,
                                  String password){
        UserAction action = Feign.builder()
                .decoder(new StringDecoder())
                .target(UserAction.class, ServerConstants.WEB_URL);

        String s = action.loginAction(userName, password);
        LoginBack back = JsonUtil.jsonToPojo(s, LoginBack.class);
        return back;
    }
}
